<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="javax.servlet.http.HttpSession" %>
<!DOCTYPE html>
<html>
<head>
    <title>医院预约系统主页</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f2f2f2;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .header {
            width: 100%;
            background-color: #4CAF50;
            color: white;
            padding: 20px;
            text-align: center;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .header .user-info {
            display: flex;
            align-items: center;
        }
        .header .user-info span {
            margin-right: 10px;
        }
        .header .user-info a {
            color: white;
            text-decoration: none;
            background-color: #333;
            padding: 5px 10px;
            border-radius: 4px;
        }
        .header .user-info a:hover {
            background-color: #555;
        }
        .container {
            width: 80%;
            max-width: 1200px;
            margin: 20px auto;
            padding: 20px;
            background-color: white;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
        }
        .features {
            display: flex;
            justify-content: space-around;
            margin-top: 30px;
        }
        .feature {
            text-align: center;
            width: 30%;
        }
        .feature img {
            width: 100px;
            height: 100px;
        }
        .feature h3 {
            margin: 15px 0;
        }
        .feature p {
            color: #777;
        }
        .feature a {
            display: block;
            margin-top: 10px;
            padding: 10px;
            background-color: #4CAF50;
            color: white;
            text-decoration: none;
            border-radius: 4px;
        }
        .feature a:hover {
            background-color: #45a049;
        }
        .footer {
            width: 100%;
            background-color: #4CAF50;
            color: white;
            padding: 10px;
            text-align: center;
            position: fixed;
            bottom: 0;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>&nbsp;&nbsp;欢迎来到医院预约系统</h1>
        <div class="user-info">
            <% 
                String username = (String) session.getAttribute("username");
                if (username != null) { 
            %>
                <span>欢迎, <%= username %>!</span>
                <a href="LogoutServlet">登出</a>
            <% } else { %>
                <a href="login.jsp">登录</a>
            <% } %>
        </div>
    </div>
    <div class="container">
        <h2>请选择一个功能</h2>
        <div class="features">
            <div class="feature">
                <img src="images/appointment.png" alt="预约挂号">
                <h3>预约挂号</h3>
                <p>实时查看医生情况，快速预约挂号。</p>
                <a href="appointment.jsp">立即预约</a>
            </div>
            <div class="feature">
                <img src="images/payment.png" alt="门诊缴费">
                <h3>门诊缴费</h3>
                <p>快速缴费，不用排队。</p>
                <a href="payment.jsp">立即缴费</a>
            </div>
            <div class="feature">
                <img src="images/hospitalization.png" alt="住院服务">
                <h3>住院服务</h3>
                <p>省心省力安心养病。</p>
                <a href="hospitalization.jsp">查看服务</a>
            </div>
        </div>
    </div>
    <div class="footer">
        &copy; 2024 医院预约系统
    </div>
</body>
</html>
